﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//定义一个方法，实现一维数组的排序功能，从大到小排序。(不要用Array类的方法)
namespace Demo01
{
    class Demo03
    {
        static void Main(string[] args)
        {
            int[] arr = { 19, 15, 18, 16, 17 };
            for (int i = 0; i < arr.Length-1; i++)
            {
                for (int j = 0; j < arr.Length-i-1; j++)
                {
                    if (arr[j]<arr[j+1])
                    {
                        int time = arr[j + 1];
                        arr[j + 1] = arr[j];
                        arr[j] = time;
                    }
                }
            }
            foreach (var item in arr)
            {
                Console.Write(item + "\t");
            }
        }
    }
}
